import base from '@/api/baseurl';
import request from '@/utils/request'


/* 1.调整项类型下拉选  tfpr/findType  
2.主表查询  tfpr/findPriceuler  adj_type调整类型 
3.主表的新增 tfpr/addPriceuler 
4. 主表的修改 tfpr/updatePriceuler 
5.主表的删除 tfpr/del */


/**
 * 调整规则器列表
 * @param {*} query
 * @returns
 */
export function findPriceuler(query) {
  return request({
    baseURL: base.appBaseApi,
    url: 'tfpr/findPriceuler',
    method: 'get',
    params: query
  })
}


/* 曲线维护选项-所有 */
export function transfercurveGpFingTransferCurvecodename(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/TransfercurveGp/fingTransferCurvecodename',
    method: 'get',
    params: query
  })
}

/* 曲线维护选项-被选中的参数 query:id */
export function transfercurveGpFingTransferCurvecodenamein(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/TransfercurveGp/fingTransferCurvecodenamein',
    method: 'get',
    params: query
  })
}


// 修改曲线维护参数
export function transfercurveGpAddTransferCurveGpZi(data) {
  return request({
    baseURL: base.appBaseApi,
    url: '/TransfercurveGp/addTransferCurveGpZi',
    method: 'post',
    data
  })
}


export function findAdjustTheItemGenerationScenario_m(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/atigs/like',
    method: 'get',
    params: query
  })
}

//单行删除
export function daleteTransferCurveGp(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/atigs/del',
    method: 'get',
    params: query
  })
}


export function insertFindAdjustTheItemGenerationScenario_m(data) {
  return request({
    baseURL: base.appBaseApi,
    url: '/atigs/add',
    method: 'post',
    data
  })
}

export function updateAdjustTheItemGenerationScenario_m(data) {
  return request({
    baseURL: base.appBaseApi,
    url: '/atigs/update',
    method: 'post',
    data
  })
}

export function deletetransferCurveGpBatch(data) {
  return request({
    baseURL: base.appBaseApi,
    url: '/atigs/del',
    method: 'post',
    data
  })
}

/**
 * 组成因子全部数据
 * adj_ft_code 组成因子编号
 * @param {*} query
 * @returns
 */
export function fingfactorcodename(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/tfpr/fingfactorcodename',
    method: 'get',
    params: query
  })
}

/**
 * 组成因子已选选项
 * @param {*} query
 * @returns
 */
export function fingfactorcodenamein(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/tfpr/fingfactorcodenamein',
    method: 'get',
    params: query
  })
}

/**
 * 组成因子项修改
 * @param {*} data
 * @returns
 */
export function addfactor(data) {
  return request({
    baseURL: base.appBaseApi,
    url: '/tfpr/addfactor',
    method: 'post',
    data
  })
}

/* 当前因子下的数据 （未选）  */

//  
export function findfactormapingdate(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/tfpr/findfactormapingdate',
    method: 'get',
    params: query
  })
}

/* 当前因子下已选数据 */

// /AccountBookScheme/fingfactorcodmapingin   m_id  factor_code
export function fingfactorcodmapingin(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/tfpr/fingfactorcodmapingin',
    method: 'get',
    params: query
  })
}

// /AccountBookScheme/addfactordata 节点 id （以node_id传值），。factor_code，factor_data_code(字符串)
export function addfactordata(data) {
  return request({
    baseURL: base.appBaseApi,
    url: '/tfpr/addfactordata',
    method: 'post',
    data
  })
}

export function findStatusSystemMessage(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/tfpr/findType',
    method: 'get',
    params: query
  })
}

export function addPriceuler(data) {
  return request({
    baseURL: base.appBaseApi,
    url: '/tfpr/addPriceuler',
    method: 'post',
    data
  })
}

export function updateM(data) {
  return request({
    baseURL: base.appBaseApi,
    url: '/tfpr/updatePriceuler',
    method: 'post',
    data
  })
}
export function deleteM(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/tfpr/del',
    method: 'get',
    params: query
  })
}

/**
 * 转移价格调整规则器
 * @param {*} query 
 * @returns    adj_code 调整项编码 
 */
export function codeAutoIncrement(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/tfpr/codeAutoIncrement',
    method: 'get',
    params: query
  })
}